package com.finger.forest.http;

import com.finger.forest.base.BaseApi;
import com.finger.forest.model.AlarmCheckModel;
import com.finger.forest.model.BaseModel;
import com.finger.forest.model.BayonetModel;
import com.finger.forest.model.CarInfoModel;
import com.finger.forest.model.CollectionResourceModel;
import com.finger.forest.model.CollectionRoadModel;
import com.finger.forest.model.ContactModel;
import com.finger.forest.model.FireInfoModel;
import com.finger.forest.model.FzFireModel;
import com.finger.forest.model.FzHotspot;
import com.finger.forest.model.GpsEquipmentModel;
import com.finger.forest.model.GridUserModel;
import com.finger.forest.model.InsertUserInfoModel;
import com.finger.forest.model.InsertVoiceModel;
import com.finger.forest.model.LoginModel;
import com.finger.forest.model.MobileUserModel;
import com.finger.forest.model.NoticeItemModel;
import com.finger.forest.model.Patrol;
import com.finger.forest.model.PatrolModel;
import com.finger.forest.model.PatrolTrailModel;
import com.finger.forest.model.ResourceModel;
import com.finger.forest.model.ResourceTypeModel;
import com.finger.forest.model.SendMessageModel;
import com.finger.forest.model.SignModel;
import com.finger.forest.model.StationModel;
import com.finger.forest.model.UserManagerModel;
import com.finger.forest.model.VoiceListModel;
import com.finger.forest.model.WorkLogModel;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;

/**
 * retrofit的接口(java的接口)
 */
public interface RetrofitJavaService {

    /**
     * 用户登录
     *
     * @param username
     * @param password
     * @param isonline
     * @return
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_LOGIN)
    Call<BaseModel<GridUserModel>> userLogin(@Field("username") String username,
                                             @Field("password") String password,
                                             @Field("isonline") String isonline);

    /**
     * 首页用户消息列表
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_MESSAGE_LIST)
    Call<BaseModel<List<NoticeItemModel>>> userNoticeList(@FieldMap Map<String, Object> maps);

    /**
     * 首页用户消息置顶
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_MESSAGE_TOP)
    Call<BaseModel<String>> userNoticeTop(@FieldMap Map<String, Object> maps);

    /**
     * 首页用户消息已读
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_MESSAGE_READ)
    Call<BaseModel<String>> userNoticeRead(@FieldMap Map<String, Object> maps);

    /**
     * 首页用户消息删除
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_MESSAGE_DELETE)
    Call<BaseModel<String>> userNoticeDelete(@FieldMap Map<String, Object> maps);

    /**
     * 联系人删除
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.CONTACT_DELETE)
    Call<BaseModel<String>> contactDelete(@FieldMap Map<String, Object> maps);

    /**
     * 巡护上报
     *
     * @param patrolId    巡护表id
     * @param type        类型 1：有害生物；2：盗砍乱伐；3：毁林开垦；4：乱捕乱猎；5：牲畜毁林；6：自然灾害；7：野生动物；8：野生植物；9：其他。
     * @param remark      备注
     * @param longitude   经度
     * @param latitude    纬度
     * @param findTime    发现时间
     * @param findAddress 发现地点
     * @param imageFile   照片
     * @param voiceFile   音频
     * @param videoFile   视频
     */
   /* @FormUrlEncoded
    @POST(BaseApi.SAVE_PATROL)
    Call<BaseModel<PatrolModel>> savePatrol(@Field("patrolId")int patrolId, @Field("type")int type, @Field("remark")String remark, @Field("longitude")BigDecimal longitude,
                                            @Field("latitude")BigDecimal latitude, @Field("findTime")String findTime, @Field("findAddress")String findAddress,
                                            @Field("imageFile")File[] imageFile, @Field("voiceFile")File[] voiceFile, @Field("videoFile")File[] videoFile);*/

    /*@Multipart
    @POST(BaseApi.SAVE_PATROL)
    Call<BaseModel<PatrolModel>> savePatrol(int patrolId, int type, String remark, BigDecimal longitude,
                                            BigDecimal latitude, String findTime, String findAddress,
                                            File[] imageFile, File[] voiceFile, File[] videoFile);*/
    @Multipart
    @POST(BaseApi.SAVE_PATROL)
    Call<BaseModel<PatrolModel>> recognition(@PartMap Map<String, RequestBody> bodyMap, @Part MultipartBody.Part imageFile);

    @Multipart
    @POST(BaseApi.SAVE_PATROL)
    Call<BaseModel<PatrolModel>> recognitions(@PartMap Map<String, RequestBody> bodyMap,
                                              @Part List<MultipartBody.Part> imageFile, @Part List<MultipartBody.Part> voiceFile, @Part List<MultipartBody.Part> vedioFile);

    /**
     * 用户注册发送验证码
     *
     * @param cellphone
     * @param type
     * @return
     */
    @FormUrlEncoded
    @POST(BaseApi.SEND_MSG)
    Call<BaseModel<SendMessageModel>> loadLoginSmsCode(@Field("cellphone") String cellphone,
                                                       @Field("type") int type);

    /**
     * 用户注册
     *
     * @param cellphone
     * @param password
     * @param phoneCode
     * @return
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_REGISTER)
    Call<BaseModel<LoginModel>> userRegister(@Field("cellphone") String cellphone,
                                             @Field("password") String password,
                                             @Field("phoneCode") String phoneCode,
                                             @Field("cityCode") String cityCode);

    /**
     * 忘记密码
     *
     * @param newPass
     * @param phoneCode
     * @param cellphone
     * @return
     */
    @FormUrlEncoded
    @POST(BaseApi.FORGET_PASSWORD)
    Call<BaseModel<String>> forgetPassWord(@Field("newPass") String newPass,
                                           @Field("phoneCode") String phoneCode,
                                           @Field("cellphone") String cellphone);


    /**
     * 提交工作日志
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.SUBMIT_WORK_LOG)
    Call<BaseModel<String>> submitWorkLog(@FieldMap Map<String, Object> maps);

    /**
     * 查询工作日志
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_WORK_LOG)
    Call<BaseModel<List<WorkLogModel>>> queryWorkLog(@FieldMap Map<String, Object> maps);

    /**
     * 上班打卡
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.SUBMIT_ON_SIGN)
    Call<BaseModel<SignModel>> submitOnSign(@FieldMap Map<String, Object> maps);

    /**
     * 查詢個人信息
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.CHECK_PERSON_INFO)
    Call<BaseModel<GridUserModel>> loadPersonInfo(@FieldMap Map<String, Object> maps);

    /**
     * 获取资源类型loadResourceType
     *
     * @return
     * @pard
     */
    @GET(BaseApi.RESOURCE_TYPE)
    Call<BaseModel<List<ResourceTypeModel>>> loadResourceType();

    /**
     * 用户管理loadUserManager
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_MANAGER)
    Call<BaseModel<List<GridUserModel>>> loadUserManager(@FieldMap Map<String, Object> maps);

    /**
     * 编辑（删除）用户deleteUser
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.DELETE_USER)
    Call<BaseModel<String>> deleteUser(@FieldMap Map<String, Object> maps);

    /**
     * 查询通讯信息voiceintercomByGrui
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.CHECK_VOICE_LIST)
    Call<BaseModel<List<VoiceListModel>>> voiceintercomByGrui(@FieldMap Map<String, Object> maps);

    /**
     * 新增通讯消息
     *
     * @return
     * @pard
     */
    @Multipart
    @POST(BaseApi.INSERT_VOICE_MESSAGE)
    Call<BaseModel<InsertVoiceModel>> insertVoiceintercom(@PartMap Map<String, RequestBody> bodyMap, @Part MultipartBody.Part imageFile);

    /**
     * 下班打卡
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.SUBMIT_OFF_SIGN)
    Call<BaseModel<SignModel>> submitOffSign(@FieldMap Map<String, Object> maps);

    /**
     * 查询打卡记录
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_SIGN_RECORD)
    Call<BaseModel<SignModel>> querySignByDate(@FieldMap Map<String, Object> maps);


    /**
     * 道路信息采集
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.ROAD_INFO_COLLECTION)
    Call<BaseModel<CollectionRoadModel>> roadInformationInsert(@FieldMap Map<String, Object> maps);

    /**
     * 新增火场资源信息接口
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.FIRE_INFOMATION_INSERT)
    Call<BaseModel<FireInfoModel>> fireInformationInsert(@FieldMap Map<String, Object> maps);

    /**
     * 用户道路资源信息查询
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.ROAD_INFOMATION)
    Call<BaseModel<List<CollectionRoadModel>>> loadRoadinformation(@FieldMap Map<String, Object> maps);

    /**
     * 查询资源信息列表
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.FIRE_INFOMATION)
    Call<BaseModel<List<FireInfoModel>>> loadFireinformation(@FieldMap Map<String, Object> maps);

    /**
     * 查询用户所有资源信息列表
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.RESOURCE_INFOMATION)
    Call<BaseModel<List<ResourceModel>>> loadResourceInformation(@FieldMap Map<String, Object> maps);

    /**
     * 查询热点核查
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_HOT_LIST)
    Call<BaseModel<List<FzHotspot>>> queryHotList(@FieldMap Map<String, Object> maps);

    /**
     * 查询热点核查详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_HOT_DETAIL)
    Call<BaseModel<FzHotspot>> queryHotDetail(@FieldMap Map<String, Object> maps);

    /**
     * 查询报警详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_ALARM_DETAIL)
    Call<BaseModel<FzFireModel>> queryAlarmDetail(@FieldMap Map<String, Object> maps);

    /**
     * 查询卡口详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_Bayonet_DETAIL)
    Call<BaseModel<BayonetModel>> queryBayonetDetail(@FieldMap Map<String, Object> maps);

    /**
     * 查询基站详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_STATION_DETAIL)
    Call<BaseModel<StationModel>> queryStationDetail(@FieldMap Map<String, Object> maps);

    /**
     * 核查反馈
     *
     * @param bodyMap
     * @param imageFile
     * @param voiceFile
     * @param vedioFile
     * @return
     */
    @Multipart
    @POST(BaseApi.CHECK_FEED_BACK)
    Call<BaseModel<String>> checkFeedBack(@PartMap Map<String, RequestBody> bodyMap,
                                          @Part List<MultipartBody.Part> imageFile, @Part List<MultipartBody.Part> voiceFile, @Part List<MultipartBody.Part> vedioFile);

    /**
     * 查询个人详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.USER_DETAIL)
    Call<BaseModel<GridUserModel>> getUserDetail(@FieldMap Map<String, Object> maps);

    /**
     * 查询GPS设备
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_GPS_LIST)
    Call<BaseModel<List<GpsEquipmentModel>>> queryGPSList(@FieldMap Map<String, Object> maps);

    /**
     * 查询车辆设备
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_CAR_LIST)
    Call<BaseModel<List<CarInfoModel>>> queryCarList(@FieldMap Map<String, Object> maps);

    /**
     * 查询报警核查
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_ALARM_LIST)
    Call<BaseModel<List<FzFireModel>>> queryAlarmList(@FieldMap Map<String, Object> maps);

    /**
     * 查询卡口
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_Bayonet_LIST)
    Call<BaseModel<List<BayonetModel>>> queryBayonetList(@FieldMap Map<String, Object> maps);

    /**
     * 查询基站
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_STATION_LIST)
    Call<BaseModel<List<StationModel>>> queryStationList(@FieldMap Map<String, Object> maps);

    /**
     * 报警核查反馈
     *
     * @param bodyMap
     * @param imageFile
     * @param voiceFile
     * @param vedioFile
     * @return
     */
    @Multipart
    @POST(BaseApi.ALARM_CHECK_FEED_BACK)
    Call<BaseModel<String>> alarmCheckFeedBack(@PartMap Map<String, RequestBody> bodyMap,
                                               @Part List<MultipartBody.Part> imageFile, @Part List<MultipartBody.Part> voiceFile, @Part List<MultipartBody.Part> vedioFile);

    /**
     * SOS
     *
     * @return
     */
    @Multipart
    @POST(BaseApi.UPLOAD_SOS)
    Call<BaseModel<String>> uploadSos(@PartMap() Map<String, RequestBody> bodyMap,
                                      @Part() List<MultipartBody.Part> part);

    /**
     * 上传资源采集
     *
     * @return
     */
    @Multipart
    @POST(BaseApi.UPLOAD_RESOURCE)
    Call<BaseModel<CollectionResourceModel>> uploadResource(@PartMap() Map<String, RequestBody> bodyMap,
                                                            @Part() List<MultipartBody.Part> part, @Part() List<MultipartBody.Part> part1);

    /**
     * 新增用户信息insertUserInfo
     *
     * @return
     */
    @Multipart
    @POST(BaseApi.INSERT_USER_INFO)
    Call<BaseModel<InsertUserInfoModel>> insertUserInfo(@PartMap() Map<String, RequestBody> bodyMap,
                                                        @Part() MultipartBody.Part part);

    /**
     * 查询巡护轨迹
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_PATRAL_TRAIL)
    Call<BaseModel<List<PatrolTrailModel>>> queryPatrolTrail(@FieldMap Map<String, Object> maps);

    /**
     * 查询巡护轨迹
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.ADD_PATRAL_RECORD)
    Call<BaseModel<Patrol>> addPatrolRecord(@FieldMap Map<String, Object> maps);

    /**
     * 新增联系人
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.ADD_CONTACT)
    Call<BaseModel<ContactModel>> addContact(@FieldMap Map<String, Object> maps);

    /**
     * 查询巡护发现
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_PATRAL_FIND)
    Call<BaseModel<List<Map<String, Object>>>> queryPatrolFind(@FieldMap Map<String, Object> maps);

    /**
     * 查询巡护发现
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_PATRAL_INFO)
    Call<BaseModel<List<Patrol>>> queryPatrolInfo(@FieldMap Map<String, Object> maps);

    /**
     * 更新巡护记录
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.UPDATE_PATRAL_INFO)
    Call<BaseModel<Patrol>> updatePatrolInfo(@FieldMap Map<String, Object> maps);

    /**
     * 查询道路详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_ROAD_DETAIL)
    Call<BaseModel<CollectionRoadModel>> queryRoadDetail(@FieldMap Map<String, Object> maps);

    /**
     * 查询火场详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_FIRE_DETAIL)
    Call<BaseModel<FireInfoModel>> queryFireDetail(@FieldMap Map<String, Object> maps);

    /**
     * 查询资源详情
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_RESOURCE_DETAIL)
    Call<BaseModel<ResourceModel>> queryResourceDetail(@FieldMap Map<String, Object> maps);

    /**
     * 查询联系人列表
     *
     * @return
     * @pard
     */
    @FormUrlEncoded
    @POST(BaseApi.QUERY_CONTACT_LIST)
    Call<BaseModel<List<ContactModel>>> queryContactList(@FieldMap Map<String, Object> maps);

}
